$(function(){
	/**
	 * 根据id查询数据
	 */
	var a = GetRequest();
	var id = a['id'];
	console.log( "所要修改的id="+ id );
	$.ajax({
		url:"personalInformation/finddatails",
		type:"post",
		dataType:"json",
		data:{
			id:id
		},
		success:function(json){ 
			console.log("数据返回成功！！");
			var user = json.User;
//			var province = json.provinceList;
//			var city = json.cityList;
//			var county = json.countyList;
//			console.log(province);
//			console.log(city);
//			console.log(county);
			/*个人信息user表*/
			$("#userId").val(user.id);
			$("#userName").val(user.name);
			$("#firstname").val(user.formername);
			if( user.gender == 1 ){
				$("#UserGender1").attr("checked",true);
			}else{
				$("#UserGender2").attr("checked",true);
			}
			$("#national").val(user.national);
			var localtime = user.localtime.substring(0,10);
			$("#localtimes").val(localtime);
			$("#citizenshipnumber").val(user.citizenshipnumber);
			if( user.live.province != 0 ){
				console.log( "地址省1："+user.live.province );
				console.log( "地址省1："+user.live.address_province.name );
				$("#province").append("<option value='"+user.live.province+"' selected>"+user.live.address_province.name+"</option>");
			}
			if( user.live.city != 0 ){
				$("#city").append("<option value='"+user.live.city+"' selected>"+user.live.address_city.name+"</option>");
			}
			if( user.live.county != 0 ){
				$("#county").append("<option value='"+user.live.county+"' selected>"+user.live.address_county.name+"</option>");
			}
			$("#township").val(user.live.township);
			$("#village").val(user.live.village);
			$("#gates").val(user.live.gates);
			$("#liveid1").val(user.livehouseholdid);
			if( user.live2.province != 0 ){
				console.log( "地址省1："+user.live2.province );
				console.log( "地址省1："+user.live2.address_province.name );
				$("#province2").append("<option value='"+user.live2.province+"' selected>"+user.live2.address_province.name+"</option>");
			}
			if( user.live2.city != 0 ){
				$("#city2").append("<option value='"+user.live2.city+"' selected>"+user.live2.address_city.name+"</option>");
			}
			if( user.live2.county != 0 ){
				$("#county2").append("<option value='"+user.live2.county+"' selected>"+user.live2.address_county.name+"</option>");
			}
			$("#township2").val(user.live2.township);
			$("#village2").val(user.live2.village);
			$("#gates2").val(user.live2.gates);
			$("#liveid2").val(user.livenowid);
			$("#fixedtelephone").val(user.fixedtelephone);
			$("#mobilephone").val(user.mobilephone);
			$("#emergencycontact").val(user.emergencycontact);
			$("#emergencycontactfixedtelephone").val(user.emergencycontactfixedtelephone);
			$("#emergencycontactmobilephone").val(user.emergencycontactmobilephone);
			$("#height").val(user.height);
			$("#weight").val(user.weight);
			if( user.bloodtypeid != "0" ){
				$("#bloodtype").append("<option value='"+user.bloodtypeid+"' selected>"+user.bloodtype.name+"</option>");
			}
			if( user.cultureid != "0" ){
				$("#culture").append("<option value='"+user.cultureid+"' selected>"+user.culture.name+"</option>");
			}
			if( user.religiousid != "0" ){
				$("#religious").append("<option value='"+user.religiousid+"' selected>"+user.religious.name+"</option>");
			}
			if( user.faceid != "0" ){
				$("#face").append("<option value='"+user.faceid+"' selected>"+user.face.name+"</option>");
			}
			if( user.healthid != "0" ){
				$("#health").append("<option value='"+user.healthid+"' selected>"+user.health.name+"</option>");
			}
			if( user.workingconditionsid != "0" ){
				$("#workingconditions").append("<option value='"+user.workingconditionsid+"' selected>"+user.workingconditions.name+"</option>");
			}
			if( user.maritalstatusid != "0" ){
				$("#maritalstatus").append("<option value='"+user.maritalstatusid+"' selected>"+user.maritalstatus.name+"</option>");
			}
			/*配偶信息spouse表*/
			$("#spouseId").val(user.spouse.id);
			$("#spouseUserId").val(user.spouse.userid);
			$("#spouseName").val(user.spouse.name);
			$("#identitynumber").val(user.spouse.identitynumber);
			if( user.spouse.live.province != 0 ){
				console.log( "地址省3："+user.spouse.live.province );
				console.log( "地址省3："+user.spouse.live.address_province.name );
				$("#province3").append("<option value='"+user.spouse.live.province+"' selected>"+user.spouse.live.address_province.name+"</option>");
			}
			if( user.spouse.live.city != 0 ){
				$("#city3").append("<option value='"+user.spouse.live.city+"' selected>"+user.spouse.live.address_city.name+"</option>");
			}
			if( user.spouse.live.county != 0 ){
				$("#county3").append("<option value='"+user.spouse.live.county+"' selected>"+user.spouse.live.address_county.name+"</option>");
			}
			$("#township3").val(user.spouse.live.township);
			$("#village3").val(user.spouse.live.village);
			$("#gates3").val(user.spouse.live.gates);
			$("#liveid3").val(user.spouse.liveid);
			if( user.spouse.workingconditionsid != "0" ){
				$("#workingcond").append("<option value='"+user.spouse.workingconditionsid+"' selected>"+user.spouse.workingconditions.name+"</option>");
			}
			$("#workunits").val(user.spouse.workunits);
			$("#contactnumber").val(user.spouse.contactnumber);
			/*同住关系family表*/
			var index = 0;
			for( var i = 0; i < user.family.length; i++ ){
				index ++;
			}
			if( index == 1 ){
				$("#withId1").val(user.family[0].withId);
				$("#familyUserId").val(user.family[0].userid);
				$("#betweenId1").append("<option value='"+user.family[0].betweenId+"' selected>"+user.family[0].relationship.between+"</option>");
				$("#citizenship1").val( user.family[0].citizenship );
				$("#name1").val( user.family[0].name );
				var indexGender = "";
				if( user.family[0].gender == 1 ){
					indexGender = "男";
				}else{
					indexGender = "女";
				}
				$("#gender1").append("<option value='"+user.family[0].gender+"' selected>"+indexGender+"</option>");
				console.log( "同住关系的时间1："+user.family[0].birth );
				var birth = user.family[0].birthtime; //.substring(0,10)
				$("#birth1").val( birth );
				var indexCertificate = "";
				if( user.family[0].certificate == 1 ){
					indexCertificate = "有";
				}else{
					indexCertificate = "无";
				}
				$("#certificate1").append("<option value='"+user.family[0].certificate+"' selected>"+indexCertificate+"</option>");
				var indexthisCity = "";
				if( user.family[0].thisCity == 1 ){
					indexthisCity = "是";
				}else{
					indexthisCity = "否";
				}
				$("#thisCity1").append("<option value='"+user.family[0].thisCity+"' selected>"+indexthisCity+"</option>");
			}
			console.log( user.family[0].relationship.between );
			if( index == 2 ){
				$("#withId1").val(user.family[0].withId);
				$("#withId2").val(user.family[1].withId);
				$("#familyUserId").val(user.family[0].userid);
				$("#betweenId1").append("<option value='"+user.family[0].betweenId+"' selected>"+user.family[0].relationship.between+"</option>");
				$("#citizenship1").val( user.family[0].citizenship );
				$("#name1").val( user.family[0].name );
				var indexGender = "";
				if( user.family[0].gender == 1 ){
					indexGender = "男";
				}else{
					indexGender = "女";
				}
				$("#gender1").append("<option value='"+user.family[0].gender+"' selected>"+indexGender+"</option>");
				var birth = user.family[0].birthtime; //.substring(0,10)
				$("#birth1").val( birth );
				var indexCertificate = "";
				if( user.family[0].certificate == 1 ){
					indexCertificate = "有";
				}else{
					indexCertificate = "无";
				}
				$("#certificate1").append("<option value='"+user.family[0].certificate+"' selected>"+indexCertificate+"</option>");
				var indexthisCity = "";
				if( user.family[0].thisCity == 1 ){
					indexthisCity = "是";
				}else{
					indexthisCity = "否";
				}
				$("#thisCity1").append("<option value='"+user.family[0].thisCity+"' selected>"+indexthisCity+"</option>");
				//第二条
				$("#betweenId2").append("<option value='"+user.family[1].betweenId+"' selected>"+user.family[1].relationship.between+"</option>");
				$("#citizenship2").val( user.family[1].citizenship );
				$("#name2").val( user.family[1].name );
				var indexGender = "";
				if( user.family[1].gender == 1 ){
					indexGender = "男";
				}else{
					indexGender = "女";
				}
				$("#gender2").append("<option value='"+user.family[1].gender+"' selected>"+indexGender+"</option>");
				var birth = user.family[1].birthtime; //.substring(0,10)
				$("#birth2").val( birth );
				var indexCertificate = "";
				if( user.family[1].certificate == 1 ){
					indexCertificate = "有";
				}else{
					indexCertificate = "无";
				}
				$("#certificate2").append("<option value='"+user.family[1].certificate+"' selected>"+indexCertificate+"</option>");
				var indexthisCity = "";
				if( user.family[1].thisCity == 1 ){
					indexthisCity = "是";
				}else{
					indexthisCity = "否";
				}
				$("#thisCity2").append("<option value='"+user.family[1].thisCity+"' selected>"+indexthisCity+"</option>");
			}
			if( index == 3 ){
				$("#withId1").val(user.family[0].withId);
				$("#withId2").val(user.family[1].withId);
				$("#withId3").val(user.family[2].withId);
				$("#familyUserId").val(user.family[0].userid);
				$("#betweenId1").append("<option value='"+user.family[0].betweenId+"' selected>"+user.family[0].relationship.between+"</option>");
				$("#citizenship1").val( user.family[0].citizenship );
				$("#name1").val( user.family[0].name );
				var indexGender = "";
				if( user.family[0].gender == 1 ){
					indexGender = "男";
				}else{
					indexGender = "女";
				}
				$("#gender1").append("<option value='"+user.family[0].gender+"' selected>"+indexGender+"</option>");
				var birth = user.family[0].birthtime; //.substring(0,10)
				$("#birth1").val( birth );
				var indexCertificate = "";
				if( user.family[0].certificate == 1 ){
					indexCertificate = "有";
				}else{
					indexCertificate = "无";
				}
				$("#certificate1").append("<option value='"+user.family[0].certificate+"' selected>"+indexCertificate+"</option>");
				var indexthisCity = "";
				if( user.family[0].thisCity == 1 ){
					indexthisCity = "是";
				}else{
					indexthisCity = "否";
				}
				$("#thisCity1").append("<option value='"+user.family[0].thisCity+"' selected>"+indexthisCity+"</option>");
				//第二条
				$("#betweenId2").append("<option value='"+user.family[1].betweenId+"' selected>"+user.family[1].relationship.between+"</option>");
				$("#citizenship2").val( user.family[1].citizenship );
				$("#name2").val( user.family[1].name );
				var indexGender = "";
				if( user.family[1].gender == 1 ){
					indexGender = "男";
				}else{
					indexGender = "女";
				}
				$("#gender2").append("<option value='"+user.family[1].gender+"' selected>"+indexGender+"</option>");
				var birth = user.family[1].birthtime; //.substring(0,10)
				$("#birth2").val( birth );
				var indexCertificate = "";
				if( user.family[1].certificate == 1 ){
					indexCertificate = "有";
				}else{
					indexCertificate = "无";
				}
				$("#certificate2").append("<option value='"+user.family[1].certificate+"' selected>"+indexCertificate+"</option>");
				var indexthisCity = "";
				if( user.family[1].thisCity == 1 ){
					indexthisCity = "是";
				}else{
					indexthisCity = "否";
				}
				$("#thisCity2").append("<option value='"+user.family[1].thisCity+"' selected>"+indexthisCity+"</option>");
				//第三条
				$("#betweenId3").append("<option value='"+user.family[2].betweenId+"' selected>"+user.family[2].relationship.between+"</option>");
				$("#citizenship3").val( user.family[2].citizenship );
				$("#name3").val( user.family[2].name );
				var indexGender = "";
				if( user.family[2].gender == 1 ){
					indexGender = "男";
				}else{
					indexGender = "女";
				}
				$("#gender3").append("<option value='"+user.family[2].gender+"' selected>"+indexGender+"</option>");
				var birth = user.family[2].birthtime; //.substring(0,10)
				$("#birth3").val( birth );
				var indexCertificate = "";
				if( user.family[2].certificate == 1 ){
					indexCertificate = "有";
				}else{
					indexCertificate = "无";
				}
				$("#certificate3").append("<option value='"+user.family[2].certificate+"' selected>"+indexCertificate+"</option>");
				var indexthisCity = "";
				if( user.family[2].thisCity == 1 ){
					indexthisCity = "是";
				}else{
					indexthisCity = "否";
				}
				$("#thisCity3").append("<option value='"+user.family[2].thisCity+"' selected>"+indexthisCity+"</option>");
			}
			if( index == 4 ){
				$("#withId1").val(user.family[0].withId);
				$("#withId2").val(user.family[1].withId);
				$("#withId3").val(user.family[2].withId);
				$("#withId4").val(user.family[3].withId);
				$("#familyUserId").val(user.family[0].userid);
				$("#betweenId1").append("<option value='"+user.family[0].betweenId+"' selected>"+user.family[0].relationship.between+"</option>");
				$("#citizenship1").val( user.family[0].citizenship );
				$("#name1").val( user.family[0].name );
				var indexGender = "";
				if( user.family[0].gender == 1 ){
					indexGender = "男";
				}else{
					indexGender = "女";
				}
				$("#gender1").append("<option value='"+user.family[0].gender+"' selected>"+indexGender+"</option>");
				var birth = user.family[0].birthtime; //.substring(0,10)
				$("#birth1").val( birth );
				var indexCertificate = "";
				if( user.family[0].certificate == 1 ){
					indexCertificate = "有";
				}else{
					indexCertificate = "无";
				}
				$("#certificate1").append("<option value='"+user.family[0].certificate+"' selected>"+indexCertificate+"</option>");
				var indexthisCity = "";
				if( user.family[0].thisCity == 1 ){
					indexthisCity = "是";
				}else{
					indexthisCity = "否";
				}
				$("#thisCity1").append("<option value='"+user.family[0].thisCity+"' selected>"+indexthisCity+"</option>");
				//第二条
				$("#betweenId2").append("<option value='"+user.family[1].betweenId+"' selected>"+user.family[1].relationship.between+"</option>");
				$("#citizenship2").val( user.family[1].citizenship );
				$("#name2").val( user.family[1].name );
				var indexGender = "";
				if( user.family[1].gender == 1 ){
					indexGender = "男";
				}else{
					indexGender = "女";
				}
				$("#gender2").append("<option value='"+user.family[1].gender+"' selected>"+indexGender+"</option>");
				var birth = user.family[1].birthtime; //.substring(0,10)
				$("#birth2").val( birth );
				var indexCertificate = "";
				if( user.family[1].certificate == 1 ){
					indexCertificate = "有";
				}else{
					indexCertificate = "无";
				}
				$("#certificate2").append("<option value='"+user.family[1].certificate+"' selected>"+indexCertificate+"</option>");
				var indexthisCity = "";
				if( user.family[1].thisCity == 1 ){
					indexthisCity = "是";
				}else{
					indexthisCity = "否";
				}
				$("#thisCity2").append("<option value='"+user.family[1].thisCity+"' selected>"+indexthisCity+"</option>");
				//第三条
				$("#betweenId3").append("<option value='"+user.family[2].betweenId+"' selected>"+user.family[2].relationship.between+"</option>");
				$("#citizenship3").val( user.family[2].citizenship );
				$("#name3").val( user.family[2].name );
				var indexGender = "";
				if( user.family[2].gender == 1 ){
					indexGender = "男";
				}else{
					indexGender = "女";
				}
				$("#gender3").append("<option value='"+user.family[2].gender+"' selected>"+indexGender+"</option>");
				var birth = user.family[2].birthtime; //.substring(0,10)
				$("#birth3").val( birth );
				var indexCertificate = "";
				if( user.family[2].certificate == 1 ){
					indexCertificate = "有";
				}else{
					indexCertificate = "无";
				}
				$("#certificate3").append("<option value='"+user.family[2].certificate+"' selected>"+indexCertificate+"</option>");
				var indexthisCity = "";
				if( user.family[2].thisCity == 1 ){
					indexthisCity = "是";
				}else{
					indexthisCity = "否";
				}
				$("#thisCity3").append("<option value='"+user.family[2].thisCity+"' selected>"+indexthisCity+"</option>");
				//第四条
				$("#betweenId4").append("<option value='"+user.family[3].betweenId+"' selected>"+user.family[3].relationship.between+"</option>");
				$("#citizenship4").val( user.family[3].citizenship );
				$("#name4").val( user.family[3].name );
				var indexGender = "";
				if( user.family[3].gender == 1 ){
					indexGender = "男";
				}else{
					indexGender = "女";
				}
				$("#gender4").append("<option value='"+user.family[3].gender+"' selected>"+indexGender+"</option>");
				var birth = user.family[3].birthtime; //.substring(0,10)
				$("#birth4").val( birth );
				var indexCertificate = "";
				if( user.family[2].certificate == 1 ){
					indexCertificate = "有";
				}else{
					indexCertificate = "无";
				}
				$("#certificate4").append("<option value='"+user.family[3].certificate+"' selected>"+indexCertificate+"</option>");
				var indexthisCity = "";
				if( user.family[3].thisCity == 1 ){
					indexthisCity = "是";
				}else{
					indexthisCity = "否";
				}
				$("#thisCity4").append("<option value='"+user.family[3].thisCity+"' selected>"+indexthisCity+"</option>");
			}
			/*计生信息*/
			$("#marriageId").val(user.marriage.marriageId);
			$("#marriageUserId").val(user.marriage.userid);
			if( user.marriage.husband == 1 ){
				$("#husband1").attr("checked",true);
			}else{
				$("#husband2").attr("checked",true);
			}
			if( user.marriage.babyCertificate == 1 ){
				$("#babyCertificate1").attr("checked",true);
			}else{
				$("#babyCertificate2").attr("checked",true);
			}
			if( user.marriage.validation == 1 ){
				$("#validation1").attr("checked",true);
			}else{
				$("#validation2").attr("checked",true);
			}
			$("#babyNumber").val(user.marriage.babyNumber);
			$("#childrenWomen").val(user.marriage.childrenWomen);
			$("#childrenMale").val(user.marriage.childrenMale);
			if( user.marriage.policyIn == 1 ){
				$("#policyIn1").attr("checked",true);
			}else{
				$("#policyIn2").attr("checked",true);
			}
			if( user.marriage.policyOutside == 1 ){
				$("#policyOutside1").attr("checked",true);
			}else{
				$("#policyOutside2").attr("checked",true);
			}
			if( user.marriage.certificate == 1 ){
				$("#marriagecertificate1").attr("checked",true);
			}else{
				$("#marriagecertificate2").attr("checked",true);
			}
			if( user.marriage.maintenance == 1 ){
				$("#maintenance1").attr("checked",true);
			}else{
				$("#maintenance2").attr("checked",true);
			}
			if( user.marriage.pregnancyId != 0 ){
				$("#pregnancy").append("<option value='"+user.marriage.pregnancyId+"' selected>"+user.marriage.pregnancy.pregnancy+"</option>");
			}
			var measurestime = user.marriage.measurestime;
			$("#measuress").val(measurestime);
			if( user.marriage.birth == 1 ){
				$("#marriagebirth1").attr("checked",true);
			}else{
				$("#marriagebirth2").attr("checked",true);
			}
			var birthDatetime = user.marriage.birthDatetime;
			$("#birthDates").val(birthDatetime);
			if( user.marriage.policy == 1 ){
				$("#policy1").attr("checked",true);
			}else{
				$("#policy2").attr("checked",true);
			}
			/*就业单位*/
			$("#employmentid").val(user.employment.id);
			$("#employmentUserId").val(user.employment.userid);
			$("#employingUnitsName").val(user.employment.employingUnitsName);
			$("#unitTypeId").append("<option value='"+user.employment.unitTypeId+"' selected>"+user.employment.utit_type.unitTypeName+"</option>");
			if( user.employment.live.province != 0 ){
				$("#province4").append("<option value='"+user.employment.live.province+"' selected>"+user.employment.live.address_province.name+"</option>");
			}
			if( user.employment.live.city != 0 ){
				$("#city4").append("<option value='"+user.employment.live.city+"' selected>"+user.employment.live.address_city.name+"</option>");
			}
			if( user.employment.live.county != 0 ){
				$("#county4").append("<option value='"+user.employment.live.county+"' selected>"+user.employment.live.address_county.name+"</option>");
			}
			$("#township4").val(user.employment.live.township);
			$("#village4").val(user.employment.live.village);
			$("#gates4").val(user.employment.live.gates);
			$("#liveid4").val(user.employment.liveId);
			$("#institutionalCode").val(user.employment.institutionalCode);
			$("#legalRepresentative").val(user.employment.legalRepresentative);
			$("#serviceContract").append("<option value='"+user.employment.serviceContract+"' selected>"+user.employment.serviceContract+"</option>");
			$("#employmenttelephone").val(user.employment.telephone);
			$("#insuredId").append("<option value='"+user.employment.insuredId+"' selected>"+user.employment.insured.insuredType+"</option>");
			$("#socialSecurityNumber").val(user.employment.socialSecurityNumber);
			$("#unitNumber").val(user.employment.unitNumber);
			$("#wokerNumber").val(user.employment.wokerNumber);
			$("#occupation").val(user.employment.occupation);
			$("#industryId").append("<option value='"+user.employment.industryId+"' selected>"+user.employment.industry.industryType+"</option>");
			$("#titleId").append("<option value='"+user.employment.titleId+"' selected>"+user.employment.title.titleName+"</option>");
			$("#skillId").append("<option value='"+user.employment.skillId+"' selected>"+user.employment.skill.skillType+"</option>");
			/*居住*/
			$("#Livinginformationid").val(user.livinginformation.id);
			$("#landlordid").val(user.livinginformation.landlorid);
			$("#liveUserId").val(user.livinginformation.userId);
			if( user.livinginformation.livepattenid != "0" ){
				$("#livepattenid").append("<option value='"+user.livinginformation.livepattenid+"' selected>"+user.livinginformation.livepatten.livepatten+"</option>");
			}
			if( user.livinginformation.livingreasonsid != "0" ){
				$("#livingreasonsid").append("<option value='"+user.livinginformation.livingreasonsid+"' selected>"+user.livinginformation.livingreasons.livingreasons+"</option>");
			}
			if( user.livinginformation.housecategoryid != "0" ){
				$("#housecategoryid").append("<option value='"+user.livinginformation.housecategoryid+"' selected>"+user.livinginformation.housecategory.housecategory+"</option>");
			}
			if( user.livinginformation.houseleixingid != "0" ){
				$("#houseleixingid").append("<option value='"+user.livinginformation.houseleixingid+"' selected>"+user.livinginformation.houseleixing.houseleixing+"</option>");
			}
			if( user.livinginformation.usageid != "0" ){
				$("#usageid").append("<option value='"+user.livinginformation.usageid+"' selected>"+user.livinginformation.usage.usage+"</option>");
			}
			if( user.livinginformation.live.province != 0 ){
				$("#province5").append("<option value='"+user.livinginformation.live.province+"' selected>"+user.livinginformation.live.address_province.name+"</option>");
			}
			if( user.livinginformation.live.city != 0 ){
				$("#city5").append("<option value='"+user.livinginformation.live.city+"' selected>"+user.livinginformation.live.address_city.name+"</option>");
			}
			if( user.livinginformation.live.county != 0 ){
				$("#county5").append("<option value='"+user.livinginformation.live.county+"' selected>"+user.livinginformation.live.address_county.name+"</option>");
			}
			$("#township5").val(user.livinginformation.live.township);
			$("#village5").val(user.livinginformation.live.village);
			$("#gates5").val(user.livinginformation.live.gates);
			$("#liveid5").val(user.livinginformation.houseaddress);
			$("#housename").val(user.livinginformation.landlord.housename);
			$("#telephone").val(user.livinginformation.landlord.telephone);
			$("#houseidcard").val(user.livinginformation.landlord.houseidcard);
			if( user.livinginformation.landlord.qianshuzrs == 1 ){
				$("#qianshuzrs1").attr("checked",true);
			}else{
				$("#qianshuzrs2").attr("checked",true);
			}
			$("#agent").val(user.livinginformation.landlord.agent);
			$("#agenttelephone").val(user.livinginformation.landlord.agenttelephone);
			$("#agentidcard").val(user.livinginformation.landlord.agentidcard);
			if( user.livinginformation.landlord.agqianshuzrs == 1 ){
				$("#agqianshuzrs1").attr("checked",true);
			}else{
				$("#agqianshuzrs2").attr("checked",true);
			}
			$("#infomation").val(user.livinginformation.infomation);
		},
		error:function(){
			window.location.href="404.html";
		}
	});
	
	
	
	
	
	
	
	/**
	 * 修改数据
	 */
	$("#btn_update_user").click(function(){
		/*修改个人信息*/
		$.ajax({
			url:"personalInformation/addPersonal",
			type:"post",
			dataType:"json",
			data:$('#form_personal').serialize(),
			success:function(json){ 
				console.log("添加成功！！");
				$("#user_btn_span").val("保存成功，请继续");
			},
			error:function(){
				window.location.href="404.html";
			}
		});
	});
	$("#btn_update_spouse").click(function(){
		/*修改配偶信息*/
		$.ajax({
			url:"personalInformation/addSpouse",
			type:"post",
			dataType:"json",
			data:$('#form_spouse').serialize(),
			success:function(data){ 
				console.log("添加成功！！");
				$("#spouse_btn_span").val("保存成功，请继续");
			},
			error:function(){
				window.location.href="404.html";
			}
		});
	});
		/*修改同住信息*/
	$("#btn_update_family").click(function(){
		$.ajax({
			url:"personalInformation/updateFamily",
			data:$('#form_family').serialize(),
			type:"POST",
			dataType:"json",
			success:function(data){ 
				console.log("添加成功！！");
				$("#family_btn_span").val("保存成功，请继续");
			},
			error:function(){
				window.location.href="404.html";
			}
		})
	});
		/*修改计生信息*/
	$("#btn_update_marriage").click(function(){
		$.ajax({
			url:"personalInformation/addMarriage",
			type:"post",
			dataType:"json",
			data:$('#form_marriage').serialize(),
			success:function(data){	
				console.log("添加成功！！"); 
				$("#marriage_btn_span").val("保存成功，请继续");
			},
			error : function(){
				window.location.href="404.html";   
			}
		})
	});
		/*修改就业信息*/
	$("#btn_update_employment").click(function(){
		$.ajax({
			url:"personalInformation/Addemployment",
			type:"post",
			dataType:"json",
			data:$('#form_employment').serialize(),
			success:function(json){ 
				console.log("添加成功！！");
				$("#employment_btn_span").val("保存成功，请继续");
			},
			error:function(){
				window.location.href="404.html";
			}
		});
	});
		/*修改居住信息*/
	$("#btn_update").click(function(){
		$.ajax({
			url:"personalInformation/updateUserSpFaMaEmpLiving",
			type:"post",
			dataType:"json",
			data:$('#form_live').serialize(),
			success:function(json){ 
				console.log("添加成功！！");
				//跳转到个人信息页面
                window.location.href="Audit_failed.html";
			},
			error:function(){
				window.location.href="404.html";
			}
		});
	})	
	
	/**
	 * 通过路径获取id
	 * @returns
	 */
	function GetRequest() {
		var url = location.search; //获取url中"?"符后的字串
		var theRequest = new Object();
		 if (url.indexOf("?") != -1) {
	       var str = url.substr(1);
	       strs = str.split("&");
	       for (var i = 0; i < strs.length; i++) {
		       theRequest[strs[i].split("=")[0]] = decodeURIComponent(strs[i].split("=")[1]);
		   }
		}
		return theRequest;
	}
	
})